---
--- Created by root.测试同步
--- DateTime: 17-11-20 下午2:03
---

--- 路由对象,所有路由扩展从这里开始
local _OBJ = {}
--local args = request:get()
local controller = ""
local method = ""
local controller_path = "app.controller"

function _OBJ.getExeFile(self)

    local args = request:args()
    if args[1] == "static" then
        return APP_PATH.."app"..ngx.var.uri,nil
    end

    local c = self:parseController(args)
    local a = self:parseMethod(args)
    local exefile,method = controller_path.."."..c, a
    return exefile,method
    end

function _OBJ.parseController(self,args)
    if args["c"] ~=nil then
        return args["c"]
    elseif args[1] ~=nil then
        return args[1]
    else
        return "index"
    end
end
function _OBJ.parseMethod(self,args)
    if args["a"] ~=nil then
        return args["a"]
    elseif args[1] ~=nil then
        return args[2]
    else
        return "index"
    end
end




return _OBJ